/*
 * MathUtilsTest.cpp
 *
 *  Created on: 06-12-2010
 *      Author: Przemek
 */

#include "utils/MathUtils.hpp"

#define BOOST_TEST_MODULE VectorUtils test
#include <boost/test/unit_test.hpp>
using namespace std;

BOOST_AUTO_TEST_CASE( isNearZeroTest )
{
	float value = 0.0f;

	BOOST_CHECK_EQUAL(MathUtils::isNearZero(value), true);

	value = 0.00000001f;
	BOOST_CHECK_EQUAL(MathUtils::isNearZero(value), true);

	value = 0.1f;
	BOOST_CHECK_EQUAL(MathUtils::isNearZero(value), false);
}

BOOST_AUTO_TEST_CASE( isEqualTest )
{
	float firstValue = 1.0f;
	float secondValue = 1.0f;

	BOOST_CHECK_EQUAL(MathUtils::isEqual(firstValue, secondValue), true);

	secondValue = 1.00000001f;
	BOOST_CHECK_EQUAL(MathUtils::isEqual(firstValue,secondValue), true);
}

